package com.netease.liang.ch04;

import org.aspectj.lang.annotation.*;

@Aspect
public class Audience {

    @Pointcut("execution(* com.netease.liang.ch04.Performance.perform(..))")
    public void performance() {

    }

    @Before("performance()")
    public void silenceCellPhones() {
        System.out.println("关闭手机");
    }

    @Before("performance()")
    public void takeSeats() {
        System.out.println("坐下");
    }

    @AfterReturning("performance()")
    public void applause() {
        System.out.println("鼓掌");
    }

    @AfterThrowing("performance()")
    public void demandRefund() {
        System.out.println("退票");
    }
}
